export default class DeviceShadowData {
  // 设备ID
  device_id: string;
  // 设备影子相关信息数组（对应原数据中的shadow部分）
  shadow: DeviceShadowInfo[];

  constructor(device_id: string, shadow: DeviceShadowInfo[]) {
    this.device_id = device_id;
    this.shadow = shadow;
  }
}

class DeviceShadowInfo {
  // 服务ID
  service_id: string;
  // 期望属性信息
  desired: DesiredProperties;
  // 上报属性信息
  reported: ReportedProperties;
  // 版本号
  version: number;

  constructor(service_id: string, desired: DesiredProperties, reported: ReportedProperties, version: number) {
    this.service_id = service_id;
    this.desired = desired;
    this.reported = reported;
    this.version = version;
  }
}

class DesiredProperties {
  // 期望属性中的具体属性（示例中目前为null，可按需细化类型等）
  properties: any;
  // 期望属性对应的事件时间（示例中目前为null，可按需细化类型等）
  event_time: any;

  constructor(properties: any, event_time: any) {
    this.properties = properties;
    this.event_time = event_time;
  }
}

class ReportedProperties {
  // 上报属性中的各个具体属性集合
  properties: ReportedPropertyValues;
  // 上报属性对应的事件时间
  event_time: string;

  constructor(properties: ReportedPropertyValues, event_time: string) {
    this.properties = properties;
    this.event_time = event_time;
  }
}

class ReportedPropertyValues {
  // 蜂鸣器状态
  buzzer: string;
  // 风扇状态
  fan: string;
  // LED灯状态
  led: string;
  // 湿度值
  humidity: number;
  // 温度值
  temperature: number;
  // 光照强度
  light: number;
  // 接近程度
  proximity: number;
  // 红外线相关值
  infrared: number;
  // 某个灯（Tai_light）状态
  tai_light: string;
  // 火灾检测状态
  fire: string;
  // 门锁状态
  doorlock: string;
  // 风扇档位
  fan_gear: number;

  constructor(buzzer: string, fan: string, led: string, humidity: number, temperature: number, light: number,
    proximity: number, infrared: number, tai_light: string, fire: string, doorlock: string,
    fan_gear: number) {
    this.buzzer = buzzer;
    this.fan = fan;
    this.led = led;
    this.humidity = humidity;
    this.temperature = temperature;
    this.light = light;
    this.proximity = proximity;
    this.infrared = infrared;
    this.tai_light = tai_light;
    this.fire = fire;
    this.doorlock = doorlock;
    this.fan_gear = fan_gear;
  }
}